package com.shopreg.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

@Entity
@Table(name="PRICE_DETAILS")
public class PriceDetails {

	private int priceId;
	private String price;
	private String unitQuantity;
	private ShopMenuItems shopMenuItems;
	
	@Id
	@GeneratedValue(generator="gen")
	@Column(name="PRICE_ID")
	@GenericGenerator(name="gen", strategy="foreign", parameters=@Parameter(name="property", value="shopMenuItems"))
	public int getPriceId() {
		return priceId;
	}
	public void setPriceId(int priceId) {
		this.priceId = priceId;
	}
	@Column(name="PRICE")
	public String getPrice() {
		return price;
	}
	public void setPrice(String price) {
		this.price = price;
	}
	@Column(name="UNIT_QUANTITY")
	public String getUnitQuantity() {
		return unitQuantity;
	}
	public void setUnitQuantity(String unitQuantity) {
		this.unitQuantity = unitQuantity;
	}
	@OneToOne(fetch=FetchType.EAGER)
	@PrimaryKeyJoinColumn
	public ShopMenuItems getShopMenuItems() {
		return shopMenuItems;
	}
	public void setShopMenuItems(ShopMenuItems shopMenuItems) {
		this.shopMenuItems = shopMenuItems;
	}
	
	
}
